extends "../buleisite-3/buleisite-3.gd"


var baseId = ""
func _extInit():
	._extInit()
	if isInManual():
		addSkill(sk3t1[1], sk3t1[0])
		addSkill(sk3t2[1], sk3t2[0])
	elif sk3 != 0:
		doChoiceSkill3()
	lv = 4             #等级的设置

var sk3t1 = ["弹药强化·1", "射速将产生额外收益，穿甲弹(每10%射速提高3%装甲穿透，上限60%)，高爆弹(射速越高，弹道速度越快)"]
var sk3t2 = ["弹药强化·2", "射速将产生额外收益，穿甲弹(每10%射速提高3%吸血，上限50%)，高爆弹(每10%射速提高5%溅射伤害，上限100%)"]

func doChoiceSkill3():
	var sk = get("sk3t%d"%sk3)
	addSkill(sk[1], sk[0])

func _onBattleStart():
	._onBattleStart()
	addBuff(b_buleisite.new())	

class b_buleisite:
	extends "../../../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_buleisite"	
		dispel = 2
	func _upS():
		if masCha.sk3 == 1 and masCha.ammoType == 1:
			att.penL = min(0.6, masCha.att.spd * 0.3)
		else:
			att.penL = 0

		if masCha.sk3 == 2 and masCha.ammoType == 1:
			att.suck = min(0.5, masCha.att.spd * 0.3)
		else:
			att.penL = 0

		if masCha.sk3 == 1 and masCha.ammoType == 2: 
			masCha.atkFlySpd = 200 + masCha.att.spd * 300
		else:
			masCha.resetAtkFlySpd()

	func _connect():
		masCha.connect("onAtkChara", self, "onAtkChara")
	func onAtkChara(atkInfo):
		if atkInfo.atkType == sys.AtkType.GUN and atkInfo.skill == "高爆弹" and masCha.sk3 == 2:
			atkInfo.factor += min(1, masCha.att.spd * 0.5)
